package com.hymake.pipeline;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hymake.dao.LiuyanLiuRepository;
import com.hymake.model.LiuyanLiu;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

@Component
public class LiuyanLiuDaoPipeline implements Pipeline {

	@Autowired
	private LiuyanLiuRepository liuyanRepository;

	public void process(ResultItems resultItems, Task task) {
		LiuyanLiu liuyan = resultItems.get("repo");
		if(liuyan != null) {
			liuyanRepository.save(liuyan);
		}
	}
}
